export default {
  install(Vue) {
    Vue.directive('more', {
      bind(el, binding, vnode) {
        Vue.nextTick(() => {
          const liElements = el.querySelectorAll('li');
          if (liElements.length > 0) {
            if (Array.prototype.every.call(liElements, item => getComputedStyle(item).display === 'none')) {
              el.style.display = 'none';
            }
          } else {
            el.style.display = 'none';
          }
        })
      }
    });
  }
};
